﻿
var UrlImagesPath = "";

var _Fun = {
    fileUploadify: function (fileID, ajaxPath, imgPathID, imgInfoClass) {
        jQuery("#" + fileID + "").uploadify({
            'width': Set.uploadify.width, 'height': Set.uploadify.height,
            'buttonImage': Set.uploadify.buttonImage,
            'multi': Set.uploadify.multi,
            'auto': Set.uploadify.auto,
            'successTimeout': 1000,
            //'onComplete': fun,
            'swf': Set.uploadify.swf,
            'queueID': Set.uploadify.queueID,
            'uploader': ajaxPath,
            'fileTypeExts': Set.uploadify.fileTypeExts,
            'fileTypeDesc': Set.uploadify.fileTypeDesc,
            'fileSizeLimit': Set.uploadify.fileSizeLimit,
            'queueSizeLimit': Set.uploadify.queueSizeLimit,
            'progressData': 'speed',
            'overrideEvents': ['onDialogClose'],
            'buttonText': Set.uploadify.buttonText,
            'onSelectError': function (file, errorCode, errorMsg) {
                switch (errorCode) {
                    case -100:
                        Msg.tip("error", "上传的文件数量已经超出系统限制的" + jQuery("#" + fileID + "").uploadify('settings', 'queueSizeLimit') + "个文件！", "");
                        break;
                    case -110:
                        Msg.tip("error", "文件 [" + file.name + "] 大小超出系统限制的" + jQuery("#" + fileID + "").uploadify('settings', 'fileSizeLimit') + "大小！", "");
                        break;
                    case -120:
                        Msg.tip("error", "文件 [" + file.name + "] 大小异常！", "");
                        break;
                    case -130:
                        Msg.tip("error", "文件 [" + file.name + "] 类型不正确！", "");
                        break;
                }
            },
            'onClearQueue': function (queueItemCount) {
                //alert("取消上传");
                return;
            },
            'onQueueComplete': function (queueData) {
                //alert("文件上传成功！");
                return;
            },
            'onUploadSuccess': function (file, data, response) {
                US(data);
            }

        });
    }
};
